#!/bin/sh
tags=`git describe 2>/dev/null || cat version.txt`
version=`echo ${tags} | awk -F- '{print $1}' | sed 's/^v//'`
commits=`echo ${tags} | awk -F- '{print $2}'`
sha=`echo ${tags} | awk -F- '{print $3}'`
if [ "${commits}" != "" -a "${commits}" != "0" ]
then
  version="${version}.post${commits}"
fi
printf "#ifndef GR_VERSION\n#define GR_VERSION \"${version}\"\n#endif\n"
